package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 林地指标交易平台_交易申请付款凭证 实体类。
 *
 * @author 11987
 * @since 2025-06-04
 */
@Table(value = "LINDI_TRADE_APPLICATION_CREDIT", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiTradeApplicationCredit extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 付款凭证ID
     */
    private Long creditId;

    /**
     * 交易申请ID
     */
    private Long tradeApplicationId;

    /**
     * 付款凭证文件ID
     */
    private Long creditFileId;

    /**
     * 付款凭证名称
     */
    private String creditName;

    /**
     * 付款金额
     */
    private String creditAmount;

    /**
     * 付款日期
     */
    private LocalDateTime creditDate;

    /**
     * 付款方式
     */
    private String creditType;

    /**
     * 收款方
     */
    private String creditPayee;

    /**
     * 交易流水号
     */
    private String creditCode;

    /**
     * 备注
     */
    private String remark;

    // 无参构造函数
    public LindiTradeApplicationCredit() {
    }

    // 全参构造函数
    public LindiTradeApplicationCredit(Long creditId, Long tradeApplicationId, Long creditFileId, String creditName, String creditAmount, LocalDateTime creditDate, String creditType, String creditPayee, String creditCode, String remark) {
        this.creditId = creditId;
        this.tradeApplicationId = tradeApplicationId;
        this.creditFileId = creditFileId;
        this.creditName = creditName;
        this.creditAmount = creditAmount;
        this.creditDate = creditDate;
        this.creditType = creditType;
        this.creditPayee = creditPayee;
        this.creditCode = creditCode;
        this.remark = remark;
    }

    // Getter和Setter方法
    public Long getCreditId() {
        return creditId;
    }

    public void setCreditId(Long creditId) {
        this.creditId = creditId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getCreditFileId() {
        return creditFileId;
    }

    public void setCreditFileId(Long creditFileId) {
        this.creditFileId = creditFileId;
    }

    public String getCreditName() {
        return creditName;
    }

    public void setCreditName(String creditName) {
        this.creditName = creditName;
    }

    public String getCreditAmount() {
        return creditAmount;
    }

    public void setCreditAmount(String creditAmount) {
        this.creditAmount = creditAmount;
    }

    public LocalDateTime getCreditDate() {
        return creditDate;
    }

    public void setCreditDate(LocalDateTime creditDate) {
        this.creditDate = creditDate;
    }

    public String getCreditType() {
        return creditType;
    }

    public void setCreditType(String creditType) {
        this.creditType = creditType;
    }

    public String getCreditPayee() {
        return creditPayee;
    }

    public void setCreditPayee(String creditPayee) {
        this.creditPayee = creditPayee;
    }

    public String getCreditCode() {
        return creditCode;
    }

    public void setCreditCode(String creditCode) {
        this.creditCode = creditCode;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiTradeApplicationCredit that = (LindiTradeApplicationCredit) o;
        return java.util.Objects.equals(creditId, that.creditId) &&
               java.util.Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
               java.util.Objects.equals(creditFileId, that.creditFileId) &&
               java.util.Objects.equals(creditName, that.creditName) &&
               java.util.Objects.equals(creditAmount, that.creditAmount) &&
               java.util.Objects.equals(creditDate, that.creditDate) &&
               java.util.Objects.equals(creditType, that.creditType) &&
               java.util.Objects.equals(creditPayee, that.creditPayee) &&
               java.util.Objects.equals(creditCode, that.creditCode) &&
               java.util.Objects.equals(remark, that.remark);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), creditId, tradeApplicationId, creditFileId, creditName, creditAmount, creditDate, creditType, creditPayee, creditCode, remark);
    }

    @Override
    public String toString() {
        return "LindiTradeApplicationCredit{" +
               "creditId=" + creditId +
               ", tradeApplicationId=" + tradeApplicationId +
               ", creditFileId=" + creditFileId +
               ", creditName='" + creditName + '\'' +
               ", creditAmount='" + creditAmount + '\'' +
               ", creditDate=" + creditDate +
               ", creditType='" + creditType + '\'' +
               ", creditPayee='" + creditPayee + '\'' +
               ", creditCode='" + creditCode + '\'' +
               ", remark='" + remark + '\'' +
               "} " + super.toString();
    }

    // Builder类
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long creditId;
        private Long tradeApplicationId;
        private Long creditFileId;
        private String creditName;
        private String creditAmount;
        private LocalDateTime creditDate;
        private String creditType;
        private String creditPayee;
        private String creditCode;
        private String remark;

        public Builder creditId(Long creditId) {
            this.creditId = creditId;
            return this;
        }

        public Builder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public Builder creditFileId(Long creditFileId) {
            this.creditFileId = creditFileId;
            return this;
        }

        public Builder creditName(String creditName) {
            this.creditName = creditName;
            return this;
        }

        public Builder creditAmount(String creditAmount) {
            this.creditAmount = creditAmount;
            return this;
        }

        public Builder creditDate(LocalDateTime creditDate) {
            this.creditDate = creditDate;
            return this;
        }

        public Builder creditType(String creditType) {
            this.creditType = creditType;
            return this;
        }

        public Builder creditPayee(String creditPayee) {
            this.creditPayee = creditPayee;
            return this;
        }

        public Builder creditCode(String creditCode) {
            this.creditCode = creditCode;
            return this;
        }

        public Builder remark(String remark) {
            this.remark = remark;
            return this;
        }

        public LindiTradeApplicationCredit build() {
            return new LindiTradeApplicationCredit(creditId, tradeApplicationId, creditFileId, creditName, creditAmount, creditDate, creditType, creditPayee, creditCode, remark);
        }
    }

}
